using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using ProjectBase.Utils;

namespace CMS.Web
{
    public class ViewUserControl : System.Web.UI.UserControl
    {
        public string BaseUrl
        {
            get
            {
                string url = this.Request.ApplicationPath;
                if (url.EndsWith("/"))
                    return url;
                else
                    return url + "/";
            }
        }

        public string FullBaseUrl
        {
            get
            {
                string url = SiteNavigation.GetRootPath();
                if (!url.EndsWith("/"))
                {
                    url += "/";
                }
                return url;
            }
        }

        public string HomeUrl
        {
            get
            {
                return this.FullBaseUrl + "Default.aspx";
            }
        }

        public string ThemeUrl
        {
            get
            {

                return this.FullBaseUrl + "App_Themes/" + Page.Theme + "/";
            }
        }

        public string ImageUrl
        {
            get
            {
                return this.FullBaseUrl + "Images/";
            }
        }

        public Int32 CatId
        {
            get
            {
                return CUtilities.IntegerForNull(CRequest.GetQueryUri("cid", ""));
            }
        }

        public Int32 VId
        {
            get
            {
                return CUtilities.IntegerForNull(CRequest.GetQueryUri("vid", ""));
            }
        }

        public Int32 AId
        {
            get
            {
                return CUtilities.IntegerForNull(CRequest.GetQueryUri("aid", ""));
            }
        }
    }
}
